package com.example.coffeejava.Service.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.coffeejava.Dto.PageResult;
import com.example.coffeejava.Dto.Result;
import com.example.coffeejava.Entity.Examine;
import com.example.coffeejava.Mapper.ExamineMapper;
import com.example.coffeejava.Service.ExamineService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class ExamineServiceImpl extends ServiceImpl<ExamineMapper, Examine> implements ExamineService {
   @Resource
   private ExamineMapper examineMapper;
    public Result getlist(Integer pageNum, Integer pageSize, String keyword){
        PageHelper.startPage(pageNum,pageSize);
        Page<Examine> page=examineMapper.getlist();
        System.out.println(page);
        PageResult pageResult=new PageResult();
        pageResult.setRecords(page.getResult());
        pageResult.setTotal((int) page.getTotal());
        return Result.ok(pageResult);
    }

}
